/*
 * File:   global.h
 * Author: pehladik
 *
 * Created on 21 avril 2011, 12:14
 */

#include "global.h"

RT_TASK tServeur;
RT_TASK tconnect;
RT_TASK tmove;
RT_TASK tenvoyer;
RT_TASK tbatterie;
RT_TASK twatchdog;
RT_TASK timage;
RT_TASK tmission;
RT_TASK tcalibrer;

RT_MUTEX mutexEtat;
RT_MUTEX mutexMove;
RT_MUTEX mutexBatterie;
RT_MUTEX mutexActionImage ; 
RT_MUTEX mutexCompteurCommRobot ; 
RT_MUTEX mutexServeur;
RT_MUTEX mutexMission;
RT_MUTEX mutexPosition ; 
RT_MUTEX mutexArena ; 
RT_MUTEX mutexImage;

RT_SEM semConnecterRobot;
RT_SEM semWatchDog ; 
RT_SEM semMission;
RT_SEM semCalibrer;
RT_SEM semImage ;
RT_SEM semBatterie ;

RT_QUEUE queueMsgGUI;

int etatCommMoniteur = 1;
int etatCommRobot = 1;
int actionImage = -1 ;
int compteurEchecCommRobot = 0 ;
DRobot *robot;
DMovement *move;
DServer *serveur;
DBattery *batterie;
DCamera *camera ;
DMission *mission;
DArena *arena;
DPosition *position;

int MSG_QUEUE_SIZE = 10;

int PRIORITY_TSERVEUR = 30;
int PRIORITY_TCONNECT = 20;
int PRIORITY_TMOVE = 50;
int PRIORITY_TENVOYER = 25; 
int PRIORITY_TBATTERIE = 5 ;
int PRIORITY_WATCHDOG = 90 ;
int PRIORITY_IMAGE = 10 ; 
int PRIORITY_TMISSION = 10;
int ACTION_STANDARD_ACQUISITION = -1;
int MAX_TEST_COM = 5 ;

int PERIODE_IMAGE =     600000000 ;     // 600ms
int PERIODE_DEPLACER =  200000000 ;     // 200ms
int PERIODE_BATTERIE =  250000000 ;     // 250ms
int PERIODE_WATCHDOG =  1000000000;     // 1s
